/* --------------------------- INCLUDES ------------------------------------- */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

/* --------------------------- DEFINES -------------------------------------- */

#define TRUE				1
#define FALSE				!TRUE
#define MAX_KEY_LEN			10
#define CESAR				1
#define VIGENERE			2
#define TRANS				3
#define ERROR_OK			0
#define ERROR_GRAL			-1
#define ERROR_PARAM			-2
#define ERROR_MEM			-3

/* --------------------------- PROTOTYPES ----------------------------------- */

char * getMessage(int argc, char ** argv);
//static int getConf(int argc, char ** argv);
static void frecuencias(char * texto, int * letras, int step);
static int coincidenceIndex(char * message);
static int findkey(char * message, int len, int * key);
static void nextFr(float * fr);
static int rotarH(char * texto);
static int rotarV(char * texto, int * key, int len, char * rta);
static float calcularCI(char * texto1, char * texto2);
static int checkMethod(char * texto, char * rta, int * key, int len);
static void printKey(int key);
static char * decrypt(char * message);
